package com.leyou.search.service;

import com.leyou.search.dto.SearchParamDTO;
import com.leyou.search.entity.Goods;
import com.leyou.starter.elastic.entity.PageInfo;
import reactor.core.publisher.Mono;

import java.util.List;
import java.util.Map;

/**
 * @author BaiZY on 2020/8/30.
 * @version 1.0
 */
public interface SearchService {
    /**
     * 创建索引库并设置映射
     */
    void createIndexAndMapping();

    /**
     * 加载到索引库
     */
    void loadData();

    Mono<List<String>> getSuggestion(String key);

    Mono<PageInfo<Goods>> searchGoods(SearchParamDTO searchParamDTO);

    void saveGoodsById(Long spuId);

    void deleteGoodsById(Long spuId);

    Mono<Map<String, List<?>>> listFilter(SearchParamDTO searchParamDTO);
}
